package edu.nf.ch11.pool;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;

/**
 * @author CSY
 * @date 2025 - 04 - 18
 */
public class Main {
    public static void main(String[] args) {
        ConnectionPool cp = new ConnectionPool(5);

        //此时返回的连接是一个代理对象
        Connection conn = cp.get();
        System.out.println(cp.size());

        try {
            conn.close();
            System.out.println(cp.size());
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
